CC=gcc
CFLAGS= -c -Wall
LN=gcc
LFLAGS=

ifndef RELEASE
	CFLAGS += -g -DDEBUG
endif

OBJ = obj/mediatypes.o \
      obj/mediatypes_test.o \
      obj/char_lists.o
BIN = bin/mediatypes_test
LIB = 


all: objs libs bins
clean:
	rm -rf obj lib bin

objs: ${OBJ}
libs: ${LIB}
bins: ${BIN}

bin/mediatypes_test:obj/mediatypes.o obj/mediatypes_test.o
	@ if [ ! -e bin ];then mkdir bin;fi
	${LN} -o $@ ${LFLAGS} $^

obj/mediatypes.o: src/mediatypes.c src/mediatypes.h
	@ if [ ! -e obj ];then mkdir obj;fi
	${CC} ${CFLAGS} -o $@ $<
obj/mediatypes_test.o: src/mediatypes_test.c src/mediatypes.h
	 @ if [ ! -e obj ];then mkdir obj;fi
	 ${CC} ${CFLAGS} -o $@ $<
obj/char_lists.o: src/char_lists.c src/char_lists.h
	 @ if [ ! -e obj ];then mkdir obj;fi
	${CC} ${CFLAGS} -o $@ $<
